<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>React 简单页面</title>
    <script src="https://cdn.bootcss.com/react/16.2.0/umd/react.production.min.js"></script>
    <script src="https://cdn.bootcss.com/react-dom/16.2.0/umd/react-dom.production.min.js"></script>
    <script src="https://cdn.bootcss.com/babel-standalone/6.26.0/babel.min.js"></script>

    <link href="https://cdn.bootcss.com/highlight.js/9.12.0/styles/vs2015.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>

    <script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<div id="example"></div>
<p>代码</p>
<pre><code class="js">    class HelloMessage extends React.Component{
    render(){
        return (
            < div dangerouslySetInnerHTML={{
                 __html: '< h3>hahhah< /h3>'
                }}>
            </div>
            )
        }
    }
    ReactDOM.render(
        < HelloMessage />,
        document.getElementById('example')
    );
</code>
<script type="text/babel">
    class HelloMessage extends React.Component{
        render(){
            return (
                <div dangerouslySetInnerHTML={{
                    __html: '<h3>hahhah</h3>'
                }}>
                </div>
            )
        }
    }
    ReactDOM.render(
        <HelloMessage />,
        document.getElementById('example')
    );
</script>

</body>
</html>